﻿using System.Collections.ObjectModel;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Data;
using Avalonia.Markup.Xaml;
using AvaloniaApplication1.Models;
using AvaloniaApplication1.Views;
using ReactiveUI;

namespace AvaloniaApplication1.Controls
{
    public class MyTreeControl : UserControl
    {
        public MyTreeControl()
        {
            this.InitializeComponent();
        }

        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
        }

        //public static readonly StyledProperty<string> HeadContent

        public static readonly StyledProperty<ObservableCollection<SignTreeModel>> SignModelProperty = AvaloniaProperty.Register<MyTreeControl, ObservableCollection<SignTreeModel>>(nameof(SignModel));

        /// <summary>
        /// Gets or sets the radius of the border rounded corners.
        /// </summary>
        public ObservableCollection<SignTreeModel> SignModel
        {
            get
            {
                return this.GetValue<ObservableCollection<SignTreeModel>>((AvaloniaProperty<ObservableCollection<SignTreeModel>>)MyTreeControl.SignModelProperty);
            }
            set
            {
                this.SetValue<ObservableCollection<SignTreeModel>>((AvaloniaProperty<ObservableCollection<SignTreeModel>>)MyTreeControl.SignModelProperty, value, BindingPriority.LocalValue);
            }
        }

        private void Children_PointerPressed(object sender, Avalonia.Input.PointerPressedEventArgs e)
        {
            //MainWindow showTree =new MainWindow();
            //showTree.Show();

        }

    }
}
